package com.woniu;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
@Component
public class Query {
    //Cacheable 指定缓存的key
    //value别名cacheNames  就是分组的组名
    //key 对应的在redis中的value 序列化是默认的dk序列化
@Cacheable(value = "query",key = "#root.targetClass+#root.methodName")
    public  List<String>  queryAll() {
        System.out.println("查询信息");
        List<String> list = new ArrayList<>();
        list.add("fan");
        list.add("qi");
        list.add("wen");
        return list;
    }
}
